#pragma once

#include <cppwinks/utility/singleton/SingletonFactory.h>

class MSingletonFactory : public singleton::SingletonFactory
{
public:
    MSingletonFactory();
    static MSingletonFactory *getMFactory();
};

#define __Singleton(class_name, ...)                                                                           \
    namespace SingletonClassGeneration                                                                         \
    {                                                                                                          \
        struct Singleton##class_name                                                                           \
        {                                                                                                      \
            Singleton##class_name()                                                                            \
            {                                                                                                  \
                MSingletonFactory::getMFactory()->registeredSingleton<class_name>(#class_name, ##__VA_ARGS__); \
            }                                                                                                  \
        };                                                                                                     \
        Singleton##class_name singleton##class_name;                                                           \
    }

#define Singleton(...) __Singleton(__VA_ARGS__)